package com.techwells.learningkites.adapter;

import java.util.List;

import com.techwells.learningkites.R;
import com.techwells.learningkites.controller.LoginActivity;
import com.techwells.learningkites.controller.MainPageActivity;
import com.techwells.taco.mvvm.Route;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;

public class CourseViewPagerAdapter extends PagerAdapter {
	
	private Activity mContext;
	private List<View> mList;
	

	public CourseViewPagerAdapter(Activity mContext,List<View> mList) {
		this.mList = mList;
		this.mContext = mContext;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return Integer.MAX_VALUE;
	}

	@Override
	public boolean isViewFromObject(View arg0, Object arg1) {
		// TODO Auto-generated method stub
		return arg0 == arg1;
	}

	
	@Override  
    public void destroyItem(View arg0, int arg1, Object arg2) {  
        // TODO Auto-generated method stub  
//        arg0.removeView(mList.get(arg1%mList.size()));  
    }  

    @Override  
    public Object instantiateItem(View arg0, int arg1) { 
    	
        // TODO Auto-generated method stub 
    	 try {
    	((ViewPager) arg0).addView(mList.get(arg1%mList.size()),0);  
    	 } catch (Exception e) {
         }
        return mList.get(arg1%mList.size());   
    }  

}
